﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Com.queryzer2.Dao.Base;
using Com.queryzer2.Dao.Interface;
using Com.queryzer2.Domain.Entities;
using Oracle.DataAccess.Client;
using Com.queryzer2.Domain;

namespace Com.queryzer2.Dao.Impl
{
    public class AnagInammibilitaDao : OracleDao<OracleSessionManager, ISessionModel>, IAnagInammissibilitaDao
    {
        public AnagInammibilitaDao(OracleSessionManager daoContext)
            : base(daoContext)
        {
            if (!base.Context.Session_isActive())
            {
                base.Context.Session_Init();
                base.CurrentConnection.Open();
            }
        }
        private string seletctAll = "select * from GEP_ANA_INAM";       

        #region IDao<GEP_ANA_INAM,string> Members

        public Dictionary<string, GEP_ANA_INAM> GetAll()
        {
            Oracle.DataAccess.Client.OracleCommand cmd = new Oracle.DataAccess.Client.OracleCommand(seletctAll, CurrentConnection);
            Dictionary<string, GEP_ANA_INAM> list = null;
            try
            {
                using (OracleDataReader r = cmd.ExecuteReader())
                {
                    if (r.HasRows)
                    {
                        list = new Dictionary<string, GEP_ANA_INAM>();
                        while (r.Read())
                        {
                            GEP_ANA_INAM t = DaoOracleDbHelper.MapAnagraficaInammissibilita(r);
                            list.Add(t.Ina_des_inam, t);
                        }
                    }
                }
            }
            catch (Exception e0x)
            {
                throw new ManagedException("EX-IN001", e0x);
            }
            return list;
        }



        public Com.queryzer2.Domain.Entities.GEP_ANA_INAM GetById(string id)
        {
            throw new NotImplementedException();
        }

        public void Insert(Com.queryzer2.Domain.Entities.GEP_ANA_INAM entity)
        {
            throw new NotImplementedException();
        }

        public void Update(Com.queryzer2.Domain.Entities.GEP_ANA_INAM entity)
        {
            throw new NotImplementedException();
        }

        public void Delete(string id)
        {
            throw new NotImplementedException();
        }

        #endregion

        #region IDisposable Members

        public void Dispose()
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
